﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="airport_security.aspx.cs" Inherits="airport_security" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="uid"
            DataSourceID="SqlDataSource1">
            <Columns>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                <asp:BoundField DataField="uid" HeaderText="uid" ReadOnly="True" SortExpression="uid" />
                <asp:BoundField DataField="pwd" HeaderText="pwd" SortExpression="pwd" />
                <asp:BoundField DataField="airport" HeaderText="airport" SortExpression="airport" />
            </Columns>
        </asp:GridView>
    
    </div>
        <br />
        <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataKeyNames="uid"
            DataSourceID="SqlDataSource1" Height="50px" Width="125px">
            <Fields>
                <asp:BoundField DataField="uid" HeaderText="uid" ReadOnly="True" SortExpression="uid" />
                <asp:BoundField DataField="pwd" HeaderText="pwd" SortExpression="pwd" />
                <asp:BoundField DataField="airport" HeaderText="airport" SortExpression="airport" />
                <asp:CommandField ShowInsertButton="True" />
            </Fields>
        </asp:DetailsView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:SparrowDB %>"
            DeleteCommand="DELETE FROM [airport_secu_users] WHERE [uid] = @uid" InsertCommand="INSERT INTO [airport_secu_users] ([uid], [pwd], [airport]) VALUES (@uid, @pwd, @airport)"
            SelectCommand="SELECT * FROM [airport_secu_users]" UpdateCommand="UPDATE [airport_secu_users] SET [pwd] = @pwd, [airport] = @airport WHERE [uid] = @uid">
            <DeleteParameters>
                <asp:Parameter Name="uid" Type="String" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="pwd" Type="String" />
                <asp:Parameter Name="airport" Type="String" />
                <asp:Parameter Name="uid" Type="String" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="uid" Type="String" />
                <asp:Parameter Name="pwd" Type="String" />
                <asp:Parameter Name="airport" Type="String" />
            </InsertParameters>
        </asp:SqlDataSource>
    </form>
</body>
</html>
